<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <title><spring:message code="page.child.header" /></title>

    </head>

    <body>
        <script type="text/javascript">
            $(document).ready(function() {
                $("#menu_child").addClass("active");
            });
        </script>
        <!-- navbar -->
        <jsp:include page="../header.jsp" />

        <!-- context -->
        <div class="container">
            <div class="row-fluid">
                <div class="span6">
                    <h1><spring:message code="page.child.edit.header" /></h1>
                </div>
                <div class="span6">
                </div>
            </div>

            <div class="row-fluid">
                <form:form method="post" class="form-horizontal well" action="edit" commandName="childForm">
                    <form:hidden path="child.id" />
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.name">
                            <spring:message code="page.child.edit.form.name" />
                        </form:label>
                        <div class="controls">
                            <form:input path="child.name" />
                        </div>
                    </div>
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.birthDate">
                            <spring:message code="page.child.edit.form.birthDate" /></form:label>
                            <div class="controls">
                            <form:input cssClass="datepicker" path="child.birthDate" readonly="true"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.birthPlace">
                            <spring:message code="page.child.edit.form.birthPlace" /></form:label>
                            <div class="controls">
                            <form:input path="child.birthPlace" />
                        </div>
                    </div>
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.mothersName">
                            <spring:message code="page.child.edit.form.mothersName" /></form:label>
                            <div class="controls">
                            <form:input path="child.mothersName" />
                        </div>
                    </div>
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.address">
                            <spring:message code="page.child.edit.form.address" /></form:label>
                            <div class="controls">
                            <form:input path="child.address" />
                        </div>
                    </div>
                    <div class="control-group">
                        <form:label cssClass="control-label" path="child.description">
                            <spring:message code="page.child.edit.form.description" />
                        </form:label>
                        <div class="controls">
                            <form:input path="child.description" />
                        </div>
                    </div>
                    <div class="control-group">                        

                        <form:label cssClass="control-label" path="nurseries">
                            <spring:message code="page.child.edit.form.nurseries" />
                        </form:label>

                        <div class="controls">
                            <form:select path="nurseries" items="${all_nurseries}" multiple="true" itemLabel="name" itemValue="id" />
                        </div>
                        <div class="control-group">
                            <div class="controls pull-right">

                                <div class="btn-group pull-right">
                                    <a href="list" class="btn" type="button">
                                        <i class="icon-list"></i>
                                        <spring:message code="button.cancel" />
                                    </a>
                                    <form:button class="btn btn-primary" >
                                        <i class="icon-ok"></i>
                                        <spring:message code="button.ok" />
                                    </form:button>
                                </div>
                            </div>
                        </div>
                        <form:errors />
                    </form:form>
                </div>
            </div>
        </div>
    </body>
</html>
